package com.aletto.general_store.ui.activities;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.aletto.general_store.R;
import com.aletto.general_store.configs.SubscribeEventBus;
import com.aletto.general_store.presenters.WalletAccountTemplate;
import com.aletto.general_store.utils.XHelper;
import com.aletto.general_store.utils.event.ExitEvent;

import org.greenrobot.eventbus.Subscribe;

import java.util.Objects;

/**
 * 钱包账户列表
 */
public class WalletAccountActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_wallet_account);
        XHelper.initTitle(this, R.string.title_wallet_account);

        findViewById(R.id.iv_add_wallet).setOnClickListener(v -> // 添加
                startActivity(new Intent(this, WalletImportActivity.class)));

        // 显示钱包
        new WalletAccountTemplate(findViewById(R.id.recycler_view)).execute(getLifecycle());
    }

    @Override
    protected void onResume() {
        super.onResume();
        new WalletAccountTemplate(findViewById(R.id.recycler_view)).execute(getLifecycle());
    }

}
